package com.my.blog.website.service.impl;

import com.my.blog.website.constant.WebConst;
import com.my.blog.website.dao.ManagerMapper;
import com.my.blog.website.model.Vo.ManagerVo;
import com.my.blog.website.service.IManagerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ManagerServiceImpl implements IManagerService {
    @Resource
    ManagerMapper managerMapper;
    @Override
    public List<ManagerVo> searchAllManger(){
        return managerMapper.searchAllManger();
    }

    @Override
    public int updateManagerByid(ManagerVo m) {

       return managerMapper.updateManagerByid(m);

    }
    @Override
    public String deleteByCid(int id){
        int i=0;
        i=managerMapper.deleteByCid(id);
        if (id!=0 && i!=0) {
            //relationshipService.deleteById(cid, null);
            return WebConst.SUCCESS_RESULT;
        }
        return "数据为空";
    }
  @Override
  public int addManager(ManagerVo m){
        return managerMapper.addManager(m);
  }
}
